/* 
 * File:   Box2dDistanceJoint.h
 * Author: Elevator
 *
 * Created on 25 Май 2013 г., 1:23
 */

#ifndef PHYSICS_BOX2DDISTANCEJOINT_H
#define PHYSICS_BOX2DDISTANCEJOINT_H

#include "Common/Common.h"
#include "IDistanceJoint.h"
#include "Physics/Bodies/IBody.h"
#include "Physics/Bodies/Box2dBody.h"

class b2DistanceJoint;

namespace physics {

	class Box2dDistanceJoint : public IDistanceJoint {
	public:
		Box2dDistanceJoint(
			Box2dBody* bodyA, Box2dBody* bodyB,
			b2DistanceJoint* joint );
		virtual ~Box2dDistanceJoint( );

		virtual IBody* GetBodyA( ) const;
		virtual IBody* GetBodyB( ) const;

		virtual Vec2 GetAnchorA( ) const;
		virtual Vec2 GetAnchorB( ) const;

		virtual float GetLength( ) const;
		virtual void SetLength( float value );

		virtual float GetFrequency( ) const;
		virtual void SetFrequency( float value );

		virtual float GetDampingRatio( ) const;
		virtual void SetDampingRatio( float value );

		b2DistanceJoint* GetBox2dJoint( );
		
	private:
		Box2dBody* _bodyA;
		Box2dBody* _bodyB;
		b2DistanceJoint* _joint;
	};
}
#endif	/* BOX2DDISTANCEJOINT_H */
